<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui">

<h:body>
	<ui:composition template="templates/commonPage.xhtml">
		<ui:define name="pagecontent">
			<h1>Your Order</h1>
			Nom : <h:outputText value="#{loginMB.user.firstName}"/><br />
			Prenom : <h:outputText value="#{loginMB.user.name}"/><br />
			Adresse : <h:outputText value="#{loginMB.user.address.streetNumber}"/>&nbsp;<h:outputText value="#{loginMB.user.address.street}"/><br />
			<h:outputText value="#{loginMB.user.address.zipCode}"/><br />
			
			<h:form>
				<h:dataTable value="#{displayOrderBean.orderLineList}" var="o"
					styleClass="order-table table table-hover"
					headerClass="order-table-header"
					rowClasses="order-table-odd-row,order-table-even-row">

					<h:column>

						<f:facet name="header">Order No</f:facet>

						<h:outputText value="#{o.idOrderLine}" />

					</h:column>

					<h:column>

						<f:facet name="header">Product Name</f:facet>

						<h:outputText value="#{o.label}" />

					</h:column>

					<h:column>

						<f:facet name="header">Price</f:facet>

						<h:outputText value="#{o.offerCost}" />

					</h:column>

					<h:column>

						<f:facet name="header">Quantity</f:facet>
						
						<h:outputText value="#{o.qty}" />

					</h:column>

					<h:column>

						<f:facet name="header">Total</f:facet>

						<h:outputText value="#{o.totalCost}" />

					</h:column>

				</h:dataTable>
				<div class="totalCart"><span>Total :</span><h:outputText value="#{displayOrderBean.total}" /></div>

				<h:commandLink action="#{displayOrderBean.goHomePage}" value="Go back to Home " />

			</h:form>
		</ui:define>

	</ui:composition>
</h:body>
</html>